# coding=utf-8
import random
count = 1000
items = ['soccer' , 'basketball' , 'tennis' , \
         'swimming' , 'computer' , 'Lol' , \
         'dota' , 'shopping' , 'hiking' , \
         'running' , 'consume' , 'comic' , \
         'travel' , 'communicate']

choices = [
    ['negative' , 'indifferent' , 'positive'] , ['negative' , 'indifferent' , 'positive'] , ['negative' , 'indifferent' , 'positive'] ,
    ['negative' , 'indifferent' , 'positive'] , ['negative' , 'indifferent' , 'positive'] , ['negative' , 'indifferent' , 'positive'] ,
    ['negative' , 'indifferent' , 'positive'] , ['sometimes' , 'often' , 'usually'] , ['negative' , 'indifferent' , 'positive'] ,
    ['negative' , 'indifferent' , 'positive'] , ['low' , 'middle' , 'high'] , ['negative' , 'indifferent' , 'positive'] ,
    ['less_than4' , 'equal_4' , 'more_than_4'] , ['wechat' , 'QQ' , 'weibo']
]

#下方生成n组训练集
# n = 1000
# cnt = len(items)
# for i in range(1,n+1,1):
#     fp = open('trainData/train'+str(i)+'.txt' , 'w')
#     for j in range(cnt):
#         fp.write(items[j]+'\t')
#     fp.write('\n')
#     for j in range(cnt):
#         a = random.random()*3
#         if a<1 :
#             fp.write(choices[j][0])
#         elif a<2:
#             fp.write(choices[j][1])
#         else:
#             fp.write(choices[j][2])
#         if j<cnt-1:
#             fp.write('\t')
#     fp.close()

#下方生成选择项的文件
# fp = open('public/items_choice.txt' , 'w')
# for i in range(len(items)):
#     fp.write(items[i])
#     for val in choices[i]:
#         fp.write('\t'+val)
#     fp.write('\n')

# 下方生成n组测试集
n = 187
cnt = len(items)
for i in range(1,n+1,1):
    fp = open('testData/test'+str(i)+'.txt' , 'w')
    for j in range(cnt):
        fp.write(items[j]+'\t')
    fp.write('\n')
    for j in range(cnt):
        a = random.random()*3
        if a<1 :
            fp.write(choices[j][0])
        elif a<2:
            fp.write(choices[j][1])
        else:
            fp.write(choices[j][2])
        if j<cnt-1:
            fp.write('\t')
    fp.close()